﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ArticleHome.ascx.cs" Inherits="module_ArticleHome" %>

                    <div class="view">
                    <% 
                        ArticleBusiness article = new ArticleBusiness();
                        PanelBusiness panel = new PanelBusiness();
                        PanelesEntities item = panel.getItem(ID);
                        int chanel_id = item._channelID;
                        if (Display_Container.Trim().Equals("True") || Display_Container.Trim().Equals("1"))
                            {
                                Response.Write("<div id=\"view_tt\">" + item._name + "</div>");
                            }
                        string today = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLongTimeString();
                        ArrayList items = article.getListArticle(ID, today, File1);
                        if (items != null && items.Count > 0)
                        {
                            ArticlesEntities a = null;
                            for (int i = 0; i < items.Count; i++)
                            {
                                a = (ArticlesEntities)items[i];
                                Response.Write("<div class=\"view_c\">");
                                Response.Write("<div id=\"view_l\"><a href=\"" + this.link(chanel_id, a._articlesID) + "\"><img src=\"/Building/" + a._image.Substring(1) + "\" width=\"180px\" height=\"110px\" /></a></div>");
                                Response.Write("<div id=\"view_r\">");
                                Response.Write("<a href=\"" + this.link(chanel_id, a._articlesID) + "\">" + a._name + "</a><br />");
                                Response.Write(a._summary);
                                Response.Write("</div></div>");
                                a = null;
                            }
                            ArticlesEntities tmp = (ArticlesEntities)items[items.Count - 1];
                            string old = tmp._createDate;
                            if (items.Count == int.Parse(File1))
                            {
                                ArrayList items2 = article.getListArticle(ID, old, File2);
                                if (items2 != null && items2.Count > 0)
                                {
                                    ArticlesEntities item1 = null;
                                    for (int i = 0; i < items2.Count; i++)
                                    {
                                        item1 = (ArticlesEntities)items2[i];
                                        Response.Write("<div class=\"list\">");
                                        Response.Write("<img src=\"/Building/App_Themes/view/images/icon.png\" />");
                                        Response.Write("<a href=\"" + this.link(chanel_id, item1._articlesID) + "\">" + item1._name + "</a><br />");
                                        Response.Write("</div>");
                                        item1 = null;
                                    }
                                }
                            }
                            
                        }
             
                         %>
                         </div>
							
							